import axios from 'axios'
import { Storage } from '../../storage'

const login = (form) => axios.post('/api/stu/login', form).then(res => res.data)

const register = (form) => axios.post('/api/stu/register', form).then(res => res.data)

const bindClass = url => axios.put('/api/classes/bind', { url }, {
    headers: {
        "nothing-token": Storage.get("nothing-token")
    }
}).then(res => res.data)

const getMyMsgRecord = () => axios.get(`/api/message-record/get/true`, {
    headers: {
        "nothing-token": Storage.get("nothing-token")
    }
}).then(res => res.data)

const getMyPostponeRecord = () => axios.get(`/api/work-put-postpone-record/get`, {
    headers: {
        "nothing-token": Storage.get("nothing-token")
    }
}).then(res => res.data)


export {
    login,
    register,
    bindClass,
    getMyMsgRecord,
    getMyPostponeRecord
}